package com.lixinlei.tech.common.util;


import com.lixinlei.tech.common.Codec;
import com.lixinlei.tech.common.factory.CodecFactory;
import com.lixinlei.tech.common.factory.CodecTypeEnum;

/**
 * 编解码 工具包
 */
public class CodecUtils {

    public static byte[] encode(byte[] content, CodecTypeEnum codecType) {
        Codec codec = CodecFactory.getCodec(codecType);
        return codec.encode(content);
    }

    public static byte[] decode(byte[] content, CodecTypeEnum codecType) {
        Codec codec = CodecFactory.getCodec(codecType);
        return codec.decode(content);
    }
}
